<template>
  <section>
    <h2>父组件</h2>
    <p>
      name:
      <input type="text" v-model="name" />
      {{ name }}
    </p>
    <p>
      age: <input type="text" v-model="age" />
      {{ age }}
    </p>
    <sub-component :name="name" :age="age"></sub-component>
  </section>
</template>

<script>
import SubComponent from "./sub-component.vue";

import { ref } from "vue";

export default {
  components: { SubComponent },

  setup() {
    const name = ref("");
    const age = ref("");

    return { name, age };
  },
};
</script>

<style>
</style>